home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
Games
/
connx-1.0
/
commun.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-25
|
954b
|
49 lines
/*
* socket package - supports both unix scoket files
* and TCPIP sockets. Use -DTCPIP when compiling if
* TCPIP sockets are desired.
*/
#ifndef COMMUN_H
#define COMMUN_H
/* maximum number of connections */
#define MAX_CONN 10
/* file to use for UNIX socket files */
#define SOCK_FILE "test1"
/* TCPIP port */
#define SOCK_PORT 2112
/* message sent from client to server */
typedef struct msg
{
int msg_type;
int msg_length;
char *msg;
}
gen_msg;
/* structure containing connections to server */
typedef struct msg_conn
{
int number_of_conn;
int conns[MAX_CONN];
}
msg_conn;
/* supplied functionss */
int server_open_socket (int *sock);
int server_accept_connection (int sock, msg_conn * conns);
int read_message (int *sock, gen_msg * msg_receive);
int send_message (int *sock, int type, int size, char *msg);
int close_socket (int *sock);
int check_status (int *sock);
int client_open_connection (int *sock, char *name);
#endif